$("#tbl_user").bootstrapTable({
    url:"tushu/jieyuexinxi2",
    contentType:'application/x-www-form-urlencoded',
    method:'POST',
    toolbar:'#toolbar',
    sidePagination:'server',
    pageNumber:1,//当前页
    pageSize:5,//每页条数
    pageList:[5, 10, 15, 20,'ALL'],
    dataType:'json',//返回数据的类型
    cache:false,
    pagination:true,//使用分页
    showRefresh:true,//右上角刷新按钮
    showColumns:true,//右上角,列,列表
    queryParams:function(params){
        params["tu_name"] = $("#username").val();
        params["lx.lx_id"] = $("#roleCondition").val();
        console.log(params)
        return params;
    },
    classes:'table table-hover table-striped',
    columns:[{
        checkbox:true
    },{
        field:"jy_id",
        title:"借阅信息编号",
        align:"center"
    },{
        field:"duzhe.dz_id",
        title:"借阅卡号",
        align:"center"
    },{
        field:"tushu.ts_id",
        title:"图书编号",
        align:"center"
    },{
        field:"tushu.tu_name",
        title:"图书名称",
        align:"center"
    },{
        field:"tushu.jieyue",
        title:"借阅价格",
        align:"center"
    },{
        field:"tushu.lx.lx_name",
        title:"类型",
        align:"center"
    },{
        field:"tushu.chubanshe.cbs_name",
        title:"出版社",
        align:"center"
    },{
        field:"jy_jiechu",
        title:"借出时间",
        align:"center"
    }]
});


//提交表单
function submitForm(btn) {
    var $form = $(btn).parents("#myModal").find("#myForm");
    var action = $form.attr("action");
    // var str = $form.serialize();
    $.ajax({
        url: action,
        method: "post",
        //data:str,
        //FormData(dom)
        data: new FormData($form.get(0)),
        dataType: 'json',
        processData: false,
        contentType: false,
        success: function (data) {
            if (data.result) {
                swal("操作成功！", "您完成了操作");
                //隐藏模态框
                $("#myModal").modal('hide');
                //刷新表格
                $("#tbl_user").bootstrapTable('refresh');

            }
        }
    });

}